#include <cstdio>
#include <cstring>

#include <algorithm>

using namespace std;

using u64 = unsigned long long;

constexpr u64 MOD = 1000000007;

int n, m;
int tb[100][100] = {
{0},
{0,2,6,12,22,38,64,106,174,284,462},
{0,466,482,518,618,874,1550,3314,7938,20038,51722},
{0,51728,51764,51796,51840,51904,52008,52172,52436,52860,53544},
{0,53554,53654,53698,53716,53730,53744,53758,53772,53786,53800},
{0,53816,54072,54136,54150,54158,54166,54174,54182,54190,54198},
{0,54224,54900,55004,55018,55026,55034,55042,55050,55058,55066},
{0,55108,56872,57036,57050,57058,57066,57074,57082,57090,57098},
{0,57166,61790,62054,62068,62076,62084,62092,62100,62108,62116},
{0,62226,74326,74750,74764,74772,74780,74788,74796,74804,74812},
{0,74990,106674,107358,107372,107380,107388,107396,107404,107412,107420}
};
bool a[100][100];

bool check(int i, int j) {
    bool found = false;
    if (i >= 3)
        found |= a[i][j] == a[i - 1][j] && a[i][j] == a[i - 2][j];
    if (j >= 3)
        found |= a[i][j] == a[i][j - 1] && a[i][j] == a[i][j - 2];
    if (i >= 3 && j >= 3)
        found |= a[i][j] == a[i - 1][j - 1] && a[i][j] == a[i - 2][j - 2];
    if (i >= 3 && j + 2 <= m)
        found |= a[i][j] == a[i - 1][j + 1] && a[i][j] == a[i - 2][j + 2];
    return !found;
}

int cnt;

void dfs(int i, int j) {
    if (i >= n + 1) {
        cnt++;
        return;
    }
    if (j >= m + 1) {
        dfs(i + 1, 1);
        return;
    }

    a[i][j] = 0;
    if (check(i, j))
        dfs(i, j + 1);
    a[i][j] = 1;
    if (check(i, j))
        dfs(i, j + 1);
}

int eval(int _n, int _m) {
    n = _n;
    m = _m;
    cnt = 0;
    dfs(1, 1);
    return cnt;
}

void add(u64 &a, u64 b) {
    a += b;
    if (a >= MOD)
        a -= MOD;
}

int main() {
    for (int i = 1; i <= 3; i++) {
        printf("{0,");
        for (int j = 1; j <= 15; j++) {
            printf("%d,", eval(i, j));
        }
        puts("0}");
    }
    return 0;
}
